<template>
	<div ref="background" class="background">
		<span>Bike</span><span class="hidden-sm-and-down"> Sharing</span>
	</div>
	<h2>
		Bike sharing refers to a time-share model in which companies provide bike
		sharing services on campuses, subway stations, bus stops, residential areas,
		commercial areas, public service areas, etc. Bike sharing is a new type of
		green sharing economy. It can make full use of the atrophy of bike travel
		brought by the rapid economic development of the city; it maximizes the use
		of public road passage rate. Bike sharing has been attracting more and more
		attention
	</h2>
	<SC class="scClass" />
</template>

<script setup>
import { onMounted } from "vue";
import SC from "../components/ScrollingContent.vue";

onMounted(() => {
	const background = document.querySelector(".background");

	document.addEventListener("scroll", () => {
		const scrollY = window.scrollY;
		background.style.backgroundPosition = `calc(50% + ${scrollY}px) calc(50% + ${scrollY}px)`;
	});
});
</script>

<style scoped>
body {
	margin: 0;
	padding: 0;
	height: 200vh;
	overflow-x: hidden;
}

.scClass {
	margin-top: 20px;
	margin-bottom: 20px;
}

.background {
	background-image: url("./mountain/range.jpg");
	background-size: cover;
	background-position: 50% 50%;
	height: 130vh;
	font: 400 19rem "";
	line-height: 90vh;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	position: relative;
	text-align: center;
	overflow: hidden;
}

.background::before {
	content: "";
	background-size: cover;
	background-image: inherit;
	background-position: 50% 50%;
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	z-index: -99;
}

h1 {
	position: absolute;
	text-align: center;
	width: 100%;
	letter-spacing: 10px;
	color: #fff;
}

h2 {
	position: absolute;
	letter-spacing: 2px;
	top: 80vh;
	width: 60%;
	color: #fff;
	left: 50%;
	transform: translateX(-50%);
	padding: 30px;
	background-color: rgba(0, 0, 0, 0.3);
}

* {
	border-radius: 5px;
}
</style>

<script>
import "element-plus/theme-chalk/display.css";
</script>
